﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data.OleDb;
namespace DAO
{
     public class DAO_LoaiSach
    {

         public static bool themloaisach(DTO_LoaiSach loaisach)
         {
             string truyvan= string.Format( "insert into loaisach(tenloaisach) values('" + loaisach.TenLoaiSach + "')");
             if (DataProvider.Capnhatdl(truyvan) > 0)
             {
                 return true;
             }
             return false;
         }
         public static bool xoaloaisach(DTO_LoaiSach loaisach)
         {
             string truyvan = string.Format("delete from loaisach where maloaisach =" + loaisach.Maloaisach);
             if (DataProvider.Capnhatdl(truyvan) > 0)
             {
                 return true;
             }
             return false;
         }
         public static bool sualoaisach(DTO_LoaiSach loaisach)
         {
             string truyvan=string.Format("update loaisach set tenloaisach='"+loaisach.TenLoaiSach+"' where maloaisach="+loaisach.Maloaisach);
             if (DataProvider.Capnhatdl(truyvan) > 0)
             {
                 return true;
             }
             return false;
         }
    }
}
